<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateNetCoursesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('net_courses', function (Blueprint $table) {
            $table->id();
            $table->text('province')->nullable()->comment('关联省份数组');
            $table->string('name')->nullable()->comment('名称');
            $table->string('icon')->nullable()->comment('图标');
            $table->string('thumb')->nullable()->comment('封面图');
            $table->text('course_column_ids')->nullable()->comment('专栏ids');
            $table->longText('components')->nullable()->comment('页面组件');
            $table->integer('section_count')->default(0)->comment('总课程节数');
            $table->timestamps();
        });

        DB::statement("ALTER TABLE net_courses comment '网课详情页面'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('net_courses');
    }
}
